package com.hp.TrimClient;

import java.util.List;

import com.hp.TrimClient.Enums.BaseObjectTypes;

public class TrimMainObjectSearchResponse<T> implements ServiceObject {
	
	private transient TrimClient trimClient;
	public BaseObjectTypes getTrimType() {
		return TrimType;
	}

	public void setTrimType(BaseObjectTypes trimType) {
		TrimType = trimType;
	}


	private BaseObjectTypes TrimType;
	private List<T> Results;

	private Boolean clientSet = false;
	public List<T> getResults() {
		if (!clientSet) {
			clientSet = true;
			for (T tmo : Results) {
				if (tmo instanceof ServiceObject) {
					((ServiceObject)tmo).setTrimClient(this.trimClient);
				}
			}
		}
		return Results;
	}

	

	public void setResults(List<T> results) {

		Results = results;
	}

	@Override
	public void setTrimClient(TrimClient trimClient) {
		this.trimClient = trimClient;
		
	}
	
	

}
